home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{680D6CE5-E3BD-11D2-917D-0020AF1BB280}#9.0#0"; "TurbanDateControl.ocx"
- Begin VB.Form frmSampleDate
- BorderStyle = 1 'Fixed Single
- Caption = "Date Sample"
- ClientHeight = 5985
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 5760
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5985
- ScaleWidth = 5760
- StartUpPosition = 3 'Windows Default
- Begin VB.Frame fraUnbound
- Caption = "Unbound"
- Height = 1335
- Left = 240
- TabIndex = 13
- Top = 240
- Width = 5175
- Begin VB.ComboBox cboFormat
- Height = 315
- Left = 240
- Style = 2 'Dropdown List
- TabIndex = 15
- Top = 840
- Width = 3255
- End
- Begin VB.CommandButton cmdValidity
- Caption = "Validity Test"
- Height = 255
- Left = 3600
- TabIndex = 2
- Top = 960
- Width = 1455
- End
- Begin VB.CommandButton cmdToggleCalendar
- Caption = "Toggle Calendar"
- Height = 255
- Left = 3600
- TabIndex = 4
- Top = 600
- Width = 1455
- End
- Begin VB.CommandButton cmdTestSpinOnOff
- Caption = "Toggle Spin"
- Height = 255
- Left = 3600
- TabIndex = 3
- Top = 240
- Width = 1455
- End
- Begin VB.CommandButton cmdTestSelText
- Caption = "Select Text"
- Height = 255
- Left = 2040
- TabIndex = 1
- Top = 240
- Width = 1455
- End
- Begin TurbanDateControl.TurbanDate TurbanDate1
- Height = 315
- HelpContextID = 101
- Left = 240
- TabIndex = 0
- ToolTipText = "TurbanDate tooltip"
- Top = 360
- Width = 1635
- _ExtentX = 2884
- _ExtentY = 556
- Text = "3/15/1999"
- TextWidth = 1335
- SpinLeft = 1060
- DateFormat = "m/d/yyyy"
- BackColor = 33023
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = 16777215
- End
- End
- Begin VB.Frame fraBound
- Caption = "Bound "
- Height = 1815
- Left = 240
- TabIndex = 9
- Top = 1560
- Width = 5175
- Begin VB.TextBox txtClient
- DataField = "Client"
- DataSource = "datAppointments"
- Height = 285
- Left = 120
- TabIndex = 5
- Top = 600
- Width = 1695
- End
- Begin VB.Data datAppointments
- Caption = "Appointment: "
- Connect = "Access"
- DatabaseName = "C:\dvlp\TurbanDate\DATETIME.MDB"
- DefaultCursorType= 0 'DefaultCursor
- DefaultType = 2 'UseODBC
- Exclusive = -1 'True
- Height = 315
- Left = 120
- Options = 0
- ReadOnly = 0 'False
- RecordsetType = 1 'Dynaset
- RecordSource = "Appointments"
- Top = 1200
- Width = 2655
- End
- Begin VB.CommandButton cmdAdd
- Caption = "Add"
- Height = 255
- Left = 3000
- TabIndex = 7
- Top = 1200
- Width = 855
- End
- Begin VB.CommandButton cmdRemove
- Caption = "Remove"
- Height = 255
- Left = 3960
- TabIndex = 8
- Top = 1200
- Width = 855
- End
- Begin TurbanDateControl.TurbanDate TurbanDate2
- DataField = "Date"
- DataSource = "datAppointments"
- Height = 315
- Left = 1920
- TabIndex = 6
- Top = 600
- Width = 1635
- _ExtentX = 2884
- _ExtentY = 556
- TextWidth = 1335
- SpinLeft = 1060
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin VB.Label lblCaption
- Caption = "Client:"
- Height = 255
- Index = 0
- Left = 120
- TabIndex = 12
- Top = 360
- Width = 1215
- End
- Begin VB.Label lblCaption
- Caption = "Date:"
- Height = 255
- Index = 1
- Left = 1920
- TabIndex = 11
- Top = 360
- Width = 1215
- End
- End
- Begin VB.ListBox lisActivity
- Height = 1815
- Left = 240
- TabIndex = 10
- Top = 3840
- Width = 5175
- End
- Begin VB.Label lblCaption
- Caption = "Area for debugging: (Double click listbox to clear)"
- Height = 255
- Index = 2
- Left = 240
- TabIndex = 14
- Top = 3600
- Width = 3855
- End
- Attribute VB_Name = "frmSampleDate"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cboFormat_Click()
- TurbanDate1.DateFormat = cboFormat.ListIndex
- End Sub
- Private Sub cmdAdd_Click()
- If datAppointments.Recordset.RecordCount > 0 Then
- datAppointments.Recordset.Move 0
- datAppointments.Recordset.Requery
- End If
- With datAppointments.Recordset
- .AddNew
- !client = "** New **"
- !Date = Date
- !Time = Time
- .Update
- .Bookmark = .LastModified
- txtClient.SetFocus
- End With
- End Sub
- Private Sub cmdRemove_Click()
- Dim intLastPos As Integer
- With datAppointments.Recordset
- intLastPos = .AbsolutePosition
- If .RecordCount > 0 Then
- .Move 0
- Else
- .Requery
- End If
- .Delete
- If .RecordCount = 0 Then
- cmdAdd_Click
- Exit Sub
- End If
- If intLastPos < 1 Then
- .MoveNext
- Else
- .MovePrevious
- End If
- End With
- End Sub
- Private Sub cmdTestSelText_Click()
- TurbanDate1.SelStart = 2
- TurbanDate1.SelLength = 2
- TurbanDate1.SetFocus
- End Sub
- Private Sub cmdTestSpinOnOff_Click()
- TurbanDate1.Spin = Not (TurbanDate1.Spin)
- End Sub
- Private Sub cmdToggleCalendar_Click()
- TurbanDate1.Calendar = Not (TurbanDate1.Calendar)
- End Sub
- Private Sub cmdValidity_Click()
- If TurbanDate1.DateIsValid Then
- lisActivity.AddItem TurbanDate1.Text & " is valid"
- lisActivity.AddItem TurbanDate1.Text & " is not valid"
- End If
- End Sub
- Private Sub datAppointments_Reposition()
- Const DAT_CAPTION = "Appointment: "
- datAppointments.Caption = DAT_CAPTION & datAppointments.Recordset.AbsolutePosition + 1
- End Sub
- Private Sub Form_Activate()
- datAppointments.RecordsetType = vbRSTypeDynaset
- datAppointments.RecordSource = "Select * from [Appointments]"
- datAppointments.Refresh
- End Sub
- Private Sub Form_Load()
- cboFormat.AddItem "LeadingZerosCentury" ' enmDateFormat.LeadingZerosCentury
- cboFormat.AddItem "LeadingZerosNoCentury" 'enmDateFormat.LeadingZerosNoCentury
- cboFormat.AddItem "NoLeadingZerosCentury" 'enmDateFormat.NoLeadingZerosCentury
- cboFormat.AddItem "NoLeadingZerosNoCentury" 'enmDateFormat.NoLeadingZerosNoCentury
- cboFormat.ListIndex = TurbanDate1.DateFormat
- End Sub
- Private Sub lisActivity_DblClick()
- lisActivity.Clear
- End Sub
- Private Sub TurbanDate1_DateChanged()
- lisActivity.AddItem "Date changed"
- End Sub
- Private Sub TurbanDate1_DateError(objErr As ErrObject, strCustom As String)
- lisActivity.AddItem "Date Error: " & strCustom
- End Sub
- Private Sub TurbanDate1_DateInvalid()
- lisActivity.AddItem "Date Invalid " & TurbanDate1.Text
- End Sub
- Private Sub TurbanTime1_GotFocus()
- lisActivity.AddItem "Time GotFocus"
- End Sub
- Private Sub TurbanTime1_TimeChanged()
- lisActivity.AddItem "Time changed " & TurbanTime1.Text
- End Sub
- Private Sub TurbanTime1_TimeError(objErr As ErrObject, strCustom As String)
- lisActivity.AddItem "Time Error: " & strCustom
- End Sub
- Private Sub TurbanTime1_TimeInvalid()
- lisActivity.AddItem "Time Invalid"
- End Sub
- Private Sub TurbanTime2_TimeError(objErr As ErrObject, strCustom As String)
- lisActivity.AddItem "Error processing time: " & objErr.Description & "; " & strCustom
- TurbanTime2.SetFocus
- End Sub
- Private Sub TurbanTime2_TimeInvalid()
- lisActivity.AddItem "Time is not valid."
- TurbanTime2.SetFocus
- End Sub
- Private Sub TurbanDate2_DateError(objErr As ErrObject, strCustom As String)
- lisActivity.AddItem "Error processing date: " & objErr.Description & "; " & strCustom
- TurbanDate2.SetFocus
- End Sub
- Private Sub TurbanDate2_DateInvalid()
- lisActivity.AddItem "Date is not valid."
- TurbanDate2.SetFocus
- End Sub
- Private Sub TurbanDate2_DblClick()
- lisActivity.AddItem "You double clicked the date field."
- End Sub
-